//
// Copyright (C) 2011 Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.101
//#include "stdafx.h"
#include "FixedRateBond.h"
using namespace Cephei::QL::Instruments::Bonds;
#include <gen/QL/Times/DayCounter.h>
#include <gen/QL/Times/Calendar.h>
#include <gen/QL/Times/Period.h>
#include <gen/QL/Times/Schedule.h>
#include <gen/QL/InterestRate.h>
#include <gen/QL/CashFlow.h>
#include <gen/QL/PricingEngine.h>
#include <gen/QL/Instruments/Bond.h>
using namespace Cephei::QL::Times;
using namespace Cephei::QL;
using namespace Cephei::QL::Instruments;
#define HANDLE
#undef ABSTRACT
#undef STRUCT
Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (UInt32 settlementDays, Cephei::QL::Times::ICalendar^ calendar, Double faceAmount, DateTime startDate, DateTime maturityDate, Cephei::QL::Times::IPeriod^ tenor, Cephei::IVector<Double>^ coupons, Cephei::QL::Times::IDayCounter^ accrualDayCounter, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ accrualConvention, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ paymentConvention, Microsoft::FSharp::Core::FSharpOption<Double>^ redemption, Microsoft::FSharp::Core::FSharpOption<DateTime>^ issueDate, Microsoft::FSharp::Core::FSharpOption<DateTime>^ stubDate, Microsoft::FSharp::Core::FSharpOption<QL::Times::DateGeneration::RuleEnum>^ rule, Microsoft::FSharp::Core::FSharpOption<Boolean>^ endOfMonth, Cephei::QL::IPricingEngine^ QL_Pricer) : CBond(CFixedRateBond::typeid)
{
    CCalendar^ _Ccalendar;
    CPeriod^ _Ctenor;
    CoVector<Double>^ _Ccoupons;
    CDayCounter^ _CaccrualDayCounter;
    try
    {
#ifdef HANDLE
        _phFixedRateBond = NULL;
#endif
        QuantLib::Natural _settlementDays = (QuantLib::Natural)ValueHelper::Convert (settlementDays);
        _Ccalendar = safe_cast<CCalendar^> (calendar);
        _Ccalendar->Lock();
        QuantLib::Calendar& _calendar = static_cast<QuantLib::Calendar&> (_Ccalendar->GetReference ()); 
        QuantLib::Real _faceAmount = (QuantLib::Real)ValueHelper::Convert (faceAmount);
        QuantLib::Date _startDate = (QuantLib::Date)ValueHelper::Convert (startDate);
        QuantLib::Date _maturityDate = (QuantLib::Date)ValueHelper::Convert (maturityDate);
        _Ctenor = safe_cast<CPeriod^> (tenor);
        _Ctenor->Lock();
        QuantLib::Period& _tenor = static_cast<QuantLib::Period&> (_Ctenor->GetReference ()); 
        CoVector<Double>^ _Ccoupons = safe_cast<CoVector<Double>^> (coupons);
        _Ccoupons->Lock();
        INativeVector<Double>^ _NCIcoupons = _Ccoupons->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCcoupons = safe_cast<CDoubleVector^>(_NCIcoupons);
        std::vector<QuantLib::Rate>& _coupons = static_cast<std::vector<QuantLib::Rate>&> (_NCcoupons->GetReference ());
        _CaccrualDayCounter = safe_cast<CDayCounter^> (accrualDayCounter);
        _CaccrualDayCounter->Lock();
        QuantLib::DayCounter& _accrualDayCounter = static_cast<QuantLib::DayCounter&> (_CaccrualDayCounter->GetReference ()); 
        QuantLib::BusinessDayConvention _accrualConvention = 
            (Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>::IsSome::get (accrualConvention) ? (QuantLib::BusinessDayConvention)accrualConvention->Value : QuantLib::BusinessDayConvention::Following); //10
        QuantLib::BusinessDayConvention _paymentConvention = 
            (Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>::IsSome::get (paymentConvention) ? (QuantLib::BusinessDayConvention)paymentConvention->Value : QuantLib::BusinessDayConvention::Following); //10
        QuantLib::Real _redemption = 
            (Microsoft::FSharp::Core::FSharpOption<Double>::IsSome::get (redemption) ? (QuantLib::Real)ValueHelper::Convert (redemption->Value) : 100.0); //4
        QuantLib::Date _issueDate = 
            (Microsoft::FSharp::Core::FSharpOption<DateTime>::IsSome::get (issueDate) ? (QuantLib::Date)ValueHelper::Convert (issueDate->Value) : QuantLib::Date()); //4
        QuantLib::Date _stubDate = 
            (Microsoft::FSharp::Core::FSharpOption<DateTime>::IsSome::get (stubDate) ? (QuantLib::Date)ValueHelper::Convert (stubDate->Value) : QuantLib::Date()); //4
        QuantLib::DateGeneration::Rule _rule = 
            (Microsoft::FSharp::Core::FSharpOption<QL::Times::DateGeneration::RuleEnum>::IsSome::get (rule) ? (QuantLib::DateGeneration::Rule)rule->Value : QuantLib::DateGeneration::Rule::Backward); //10
        bool _endOfMonth = 
            (Microsoft::FSharp::Core::FSharpOption<Boolean>::IsSome::get (endOfMonth) ? (bool)ValueHelper::Convert (endOfMonth->Value) : false); //4
        _ppFixedRateBond = new boost::shared_ptr<QuantLib::FixedRateBond> (new QuantLib::FixedRateBond ( _settlementDays,  _calendar,  _faceAmount,  _startDate,  _maturityDate,  _tenor,  _coupons,  _accrualDayCounter,  _accrualConvention,  _paymentConvention,  _redemption,  _issueDate,  _stubDate,  _rule,  _endOfMonth ));
        CPricingEngine^ _CQL_Pricer = safe_cast<CPricingEngine^> (QL_Pricer);
        boost::shared_ptr<QuantLib::PricingEngine>& _QL_Pricer = static_cast<boost::shared_ptr<QuantLib::PricingEngine>&> (_CQL_Pricer->GetShared ());
        (*_ppFixedRateBond)->setPricingEngine (_QL_Pricer);
        SetBond (boost::dynamic_pointer_cast<QuantLib::Bond> (*_ppFixedRateBond));
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
        if (_Ccalendar != nullptr) _Ccalendar->Unlock();
        if (_Ctenor != nullptr) _Ctenor->Unlock();
        if (_Ccoupons != nullptr) _Ccoupons->Unlock();
        if (_CaccrualDayCounter != nullptr) _CaccrualDayCounter->Unlock();
    }
}
Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (UInt32 settlementDays, Double faceAmount, Cephei::QL::Times::ISchedule^ schedule, Cephei::IVector<Double>^ coupons, Cephei::QL::Times::IDayCounter^ accrualDayCounter, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ paymentConvention, Microsoft::FSharp::Core::FSharpOption<Double>^ redemption, Microsoft::FSharp::Core::FSharpOption<DateTime>^ issueDate, Cephei::QL::IPricingEngine^ QL_Pricer) : CBond(CFixedRateBond::typeid)
{
    CSchedule^ _Cschedule;
    CoVector<Double>^ _Ccoupons;
    CDayCounter^ _CaccrualDayCounter;
    try
    {
#ifdef HANDLE
        _phFixedRateBond = NULL;
#endif
        QuantLib::Natural _settlementDays = (QuantLib::Natural)ValueHelper::Convert (settlementDays);
        QuantLib::Real _faceAmount = (QuantLib::Real)ValueHelper::Convert (faceAmount);
        _Cschedule = safe_cast<CSchedule^> (schedule);
        _Cschedule->Lock();
        QuantLib::Schedule& _schedule = static_cast<QuantLib::Schedule&> (_Cschedule->GetReference ()); 
        CoVector<Double>^ _Ccoupons = safe_cast<CoVector<Double>^> (coupons);
        _Ccoupons->Lock();
        INativeVector<Double>^ _NCIcoupons = _Ccoupons->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCcoupons = safe_cast<CDoubleVector^>(_NCIcoupons);
        std::vector<QuantLib::Rate>& _coupons = static_cast<std::vector<QuantLib::Rate>&> (_NCcoupons->GetReference ());
        _CaccrualDayCounter = safe_cast<CDayCounter^> (accrualDayCounter);
        _CaccrualDayCounter->Lock();
        QuantLib::DayCounter& _accrualDayCounter = static_cast<QuantLib::DayCounter&> (_CaccrualDayCounter->GetReference ()); 
        QuantLib::BusinessDayConvention _paymentConvention = 
            (Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>::IsSome::get (paymentConvention) ? (QuantLib::BusinessDayConvention)paymentConvention->Value : QuantLib::BusinessDayConvention::Following); //10
        QuantLib::Real _redemption = 
            (Microsoft::FSharp::Core::FSharpOption<Double>::IsSome::get (redemption) ? (QuantLib::Real)ValueHelper::Convert (redemption->Value) : 100.0); //4
        QuantLib::Date _issueDate = 
            (Microsoft::FSharp::Core::FSharpOption<DateTime>::IsSome::get (issueDate) ? (QuantLib::Date)ValueHelper::Convert (issueDate->Value) : QuantLib::Date()); //4
        _ppFixedRateBond = new boost::shared_ptr<QuantLib::FixedRateBond> (new QuantLib::FixedRateBond ( _settlementDays,  _faceAmount,  _schedule,  _coupons,  _accrualDayCounter,  _paymentConvention,  _redemption,  _issueDate ));
        CPricingEngine^ _CQL_Pricer = safe_cast<CPricingEngine^> (QL_Pricer);
        boost::shared_ptr<QuantLib::PricingEngine>& _QL_Pricer = static_cast<boost::shared_ptr<QuantLib::PricingEngine>&> (_CQL_Pricer->GetShared ());
        (*_ppFixedRateBond)->setPricingEngine (_QL_Pricer);
        SetBond (boost::dynamic_pointer_cast<QuantLib::Bond> (*_ppFixedRateBond));
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
        if (_Cschedule != nullptr) _Cschedule->Unlock();
        if (_Ccoupons != nullptr) _Ccoupons->Unlock();
        if (_CaccrualDayCounter != nullptr) _CaccrualDayCounter->Unlock();
    }
}
Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (UInt32 settlementDays, Double faceAmount, Cephei::QL::Times::ISchedule^ schedule, Cephei::IVector<Cephei::QL::IInterestRate^>^ coupons, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ paymentConvention, Microsoft::FSharp::Core::FSharpOption<Double>^ redemption, Microsoft::FSharp::Core::FSharpOption<DateTime>^ issueDate, Cephei::QL::IPricingEngine^ QL_Pricer) : CBond(CFixedRateBond::typeid)
{
    CSchedule^ _Cschedule;
    CoVector<Cephei::QL::IInterestRate^>^ _Ccoupons;
    try
    {
#ifdef HANDLE
        _phFixedRateBond = NULL;
#endif
        QuantLib::Natural _settlementDays = (QuantLib::Natural)ValueHelper::Convert (settlementDays);
        QuantLib::Real _faceAmount = (QuantLib::Real)ValueHelper::Convert (faceAmount);
        _Cschedule = safe_cast<CSchedule^> (schedule);
        _Cschedule->Lock();
        QuantLib::Schedule& _schedule = static_cast<QuantLib::Schedule&> (_Cschedule->GetReference ()); 
        _Ccoupons = safe_cast<CoVector<Cephei::QL::IInterestRate^>^> (coupons);
        _Ccoupons ->Lock ();
        INativeVector<Cephei::QL::IInterestRate^>^ _NCIcoupons = _Ccoupons->getFeature (NativeFeature::Value);
        CInterestRateVector^ _NCcoupons = safe_cast<CInterestRateVector^>(_NCIcoupons);
        std::vector<QuantLib::InterestRate>& _coupons = static_cast<std::vector<QuantLib::InterestRate>&> (_NCcoupons->GetReference ());
        QuantLib::BusinessDayConvention _paymentConvention = 
            (Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>::IsSome::get (paymentConvention) ? (QuantLib::BusinessDayConvention)paymentConvention->Value : QuantLib::BusinessDayConvention::Following); //10
        QuantLib::Real _redemption = 
            (Microsoft::FSharp::Core::FSharpOption<Double>::IsSome::get (redemption) ? (QuantLib::Real)ValueHelper::Convert (redemption->Value) : 100.0); //4
        QuantLib::Date _issueDate = 
            (Microsoft::FSharp::Core::FSharpOption<DateTime>::IsSome::get (issueDate) ? (QuantLib::Date)ValueHelper::Convert (issueDate->Value) : QuantLib::Date()); //4
        _ppFixedRateBond = new boost::shared_ptr<QuantLib::FixedRateBond> (new QuantLib::FixedRateBond ( _settlementDays,  _faceAmount,  _schedule,  _coupons,  _paymentConvention,  _redemption,  _issueDate ));
        CPricingEngine^ _CQL_Pricer = safe_cast<CPricingEngine^> (QL_Pricer);
        boost::shared_ptr<QuantLib::PricingEngine>& _QL_Pricer = static_cast<boost::shared_ptr<QuantLib::PricingEngine>&> (_CQL_Pricer->GetShared ());
        (*_ppFixedRateBond)->setPricingEngine (_QL_Pricer);
        SetBond (boost::dynamic_pointer_cast<QuantLib::Bond> (*_ppFixedRateBond));
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
        if (_Cschedule != nullptr) _Cschedule->Unlock();
        if (_Ccoupons != nullptr) _Ccoupons->Unlock();
    }
}
Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (boost::shared_ptr<QuantLib::FixedRateBond>& childNative, Object^ owner) : CBond(CFixedRateBond::typeid)
{
#ifdef HANDLE
	_phFixedRateBond = NULL;
#endif
	_ppFixedRateBond = &childNative;
    _ppBond = new boost::shared_ptr<QuantLib::Bond> (boost::dynamic_pointer_cast<QuantLib::Bond> (*_ppFixedRateBond));
}
Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (QuantLib::FixedRateBond& childNative, Object^ owner) : CBond(CFixedRateBond::typeid)
{
#ifdef HANDLE
	_phFixedRateBond = NULL;
#endif
	_ppFixedRateBond = new boost::shared_ptr<QuantLib::FixedRateBond> (&childNative);
    _ppBond = new boost::shared_ptr<QuantLib::Bond> (boost::dynamic_pointer_cast<QuantLib::Bond> (*_ppFixedRateBond));
    _FixedRateBondOwner = owner;
    _BondOwner = owner;
}

Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (CFixedRateBond^ copy) : CBond(CFixedRateBond::typeid)
{
#ifdef HANDLE
	_phFixedRateBond = NULL;
#endif
	if (copy->HasNative() != NULL)
    {
		_ppFixedRateBond = new boost::shared_ptr<QuantLib::FixedRateBond> (copy->GetShared());
        _ppBond = new boost::shared_ptr<QuantLib::Bond> (boost::dynamic_pointer_cast<QuantLib::Bond> (*_ppFixedRateBond));
    }
}
Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (System::Type^ t) : CBond(CFixedRateBond::typeid)
{
#ifdef HANDLE
	_phFixedRateBond = NULL;
#endif
	if (!t->IsSubclassOf(CFixedRateBond::typeid))
		throw gcnew Exception ("Invalid base-case init");
}
#ifdef HANDLE
Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (QuantLib::Handle<QuantLib::FixedRateBond>& childNative, Object^ owner)  : CBond(CFixedRateBond::typeid)
{
	_phFixedRateBond = &childNative;
	_ppFixedRateBond = &static_cast<boost::shared_ptr<QuantLib::FixedRateBond>>(childNative.currentLink());
    _ppBond = new boost::shared_ptr<QuantLib::Bond> (boost::dynamic_pointer_cast<QuantLib::Bond> (*_ppFixedRateBond));
    _FixedRateBondOwner = owner;
}
Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (QuantLib::Handle<QuantLib::FixedRateBond> childNative)  : CBond(CFixedRateBond::typeid)
{
	_phFixedRateBond = &childNative;
	_ppFixedRateBond = &static_cast<boost::shared_ptr<QuantLib::FixedRateBond>>(childNative.currentLink());
    _ppBond = new boost::shared_ptr<QuantLib::Bond> (boost::dynamic_pointer_cast<QuantLib::Bond> (*_ppFixedRateBond));
}
#endif
#ifdef STRUCT
Cephei::QL::Instruments::Bonds::CFixedRateBond::CFixedRateBond (QuantLib::FixedRateBond childNative)  : CBond(CFixedRateBond::typeid)
{
#ifdef HANDLE
	_phFixedRateBond = NULL;
#endif
	_ppFixedRateBond = new boost::shared_ptr<QuantLib::FixedRateBond> (new QuantLib::FixedRateBond (childNative));
    _ppBond = new boost::shared_ptr<QuantLib::Bond> (boost::dynamic_pointer_cast<QuantLib::Bond> (*_ppFixedRateBond));
}
#endif

Cephei::QL::Instruments::Bonds::CFixedRateBond::~CFixedRateBond ()
{
    if (_ppFixedRateBond != NULL)
    {
	    delete _ppFixedRateBond;
        _ppFixedRateBond = NULL;
    }
}
Cephei::QL::Instruments::Bonds::CFixedRateBond::!CFixedRateBond ()
{
    if (_ppFixedRateBond != NULL)
    {
	    delete _ppFixedRateBond;
    }
}
QuantLib::FixedRateBond& Cephei::QL::Instruments::Bonds::CFixedRateBond::GetReference ()
{
    if (_ppFixedRateBond == NULL) throw gcnew NativeNullException ();
	return **_ppFixedRateBond;
}
boost::shared_ptr<QuantLib::FixedRateBond>& Cephei::QL::Instruments::Bonds::CFixedRateBond::GetShared ()
{
    if (_ppFixedRateBond == NULL) throw gcnew NativeNullException ();
	return *_ppFixedRateBond;
}
QuantLib::FixedRateBond* Cephei::QL::Instruments::Bonds::CFixedRateBond::GetPointer ()
{
    if (_ppFixedRateBond == NULL) throw gcnew NativeNullException ();
	return &**_ppFixedRateBond;
}
#ifdef HANDLE
QuantLib::Handle<QuantLib::FixedRateBond>& Cephei::QL::Instruments::Bonds::CFixedRateBond::GetHandle ()
{
	if (_phFixedRateBond == NULL)
	{
		_phFixedRateBond = new Handle<QuantLib::FixedRateBond> (*_ppFixedRateBond);
	}
	return *_phFixedRateBond;
}
#endif
bool Cephei::QL::Instruments::Bonds::CFixedRateBond::HasNative () 
{
	return (_ppFixedRateBond != NULL);
}

Cephei::QL::Times::IDayCounter^ Cephei::QL::Instruments::Bonds::CFixedRateBond::DayCounter::get ()
{
    try
    {
    	QuantLib::DayCounter& _rv = (QuantLib::DayCounter&)(*_ppFixedRateBond)->dayCounter ( );   
        Cephei::QL::Times::CDayCounter^ _nrv = gcnew Cephei::QL::Times::CDayCounter (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
QL::Times::FrequencyEnum Cephei::QL::Instruments::Bonds::CFixedRateBond::Frequency::get ()
{
    try
    {
    	QuantLib::Frequency _rv = (QuantLib::Frequency)(*_ppFixedRateBond)->frequency ( );   
        QL::Times::FrequencyEnum _nrv = (QL::Times::FrequencyEnum)_rv;
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory class

Cephei::QL::Instruments::Bonds::IFixedRateBond^ Cephei::QL::Instruments::Bonds::CFixedRateBond_Factory::Create (UInt32 settlementDays, Cephei::QL::Times::ICalendar^ calendar, Double faceAmount, DateTime startDate, DateTime maturityDate, Cephei::QL::Times::IPeriod^ tenor, Cephei::IVector<Double>^ coupons, Cephei::QL::Times::IDayCounter^ accrualDayCounter, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ accrualConvention, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ paymentConvention, Microsoft::FSharp::Core::FSharpOption<Double>^ redemption, Microsoft::FSharp::Core::FSharpOption<DateTime>^ issueDate, Microsoft::FSharp::Core::FSharpOption<DateTime>^ stubDate, Microsoft::FSharp::Core::FSharpOption<QL::Times::DateGeneration::RuleEnum>^ rule, Microsoft::FSharp::Core::FSharpOption<Boolean>^ endOfMonth, Cephei::QL::IPricingEngine^ QL_Pricer)
{
    return gcnew CFixedRateBond ( settlementDays,  calendar,  faceAmount,  startDate,  maturityDate,  tenor,  coupons,  accrualDayCounter,  accrualConvention,  paymentConvention,  redemption,  issueDate,  stubDate,  rule,  endOfMonth,  QL_Pricer);
}
Cephei::QL::Instruments::Bonds::IFixedRateBond^ Cephei::QL::Instruments::Bonds::CFixedRateBond_Factory::Create (UInt32 settlementDays, Double faceAmount, Cephei::QL::Times::ISchedule^ schedule, Cephei::IVector<Double>^ coupons, Cephei::QL::Times::IDayCounter^ accrualDayCounter, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ paymentConvention, Microsoft::FSharp::Core::FSharpOption<Double>^ redemption, Microsoft::FSharp::Core::FSharpOption<DateTime>^ issueDate, Cephei::QL::IPricingEngine^ QL_Pricer)
{
    return gcnew CFixedRateBond ( settlementDays,  faceAmount,  schedule,  coupons,  accrualDayCounter,  paymentConvention,  redemption,  issueDate,  QL_Pricer);
}
Cephei::QL::Instruments::Bonds::IFixedRateBond^ Cephei::QL::Instruments::Bonds::CFixedRateBond_Factory::Create (UInt32 settlementDays, Double faceAmount, Cephei::QL::Times::ISchedule^ schedule, Cephei::IVector<Cephei::QL::IInterestRate^>^ coupons, Microsoft::FSharp::Core::FSharpOption<QL::Times::BusinessDayConventionEnum>^ paymentConvention, Microsoft::FSharp::Core::FSharpOption<Double>^ redemption, Microsoft::FSharp::Core::FSharpOption<DateTime>^ issueDate, Cephei::QL::IPricingEngine^ QL_Pricer)
{
    return gcnew CFixedRateBond ( settlementDays,  faceAmount,  schedule,  coupons,  paymentConvention,  redemption,  issueDate,  QL_Pricer);
}
